home *** CD-ROM | disk | FTP | other *** search
- // GnucleusDoc.h : interface of the CGnucleusDoc class
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #if !defined(AFX_GNUCLEUSDOC_H__1AE2E5D0_1AB4_11D4_ACF2_00A0CC533D52__INCLUDED_)
- #define AFX_GNUCLEUSDOC_H__1AE2E5D0_1AB4_11D4_ACF2_00A0CC533D52__INCLUDED_
-
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
-
- #include "packet.h" // Packet type definitions
- #pragma warning(disable: 4786)
- #include <vector>
- #include <set>
- #include <list>
- #include <afxtempl.h> // Support for templated classes like CList
-
- class CGnucleusDoc : public CDocument
- {
- friend class CGnuTransfer;
- friend class CGnuHash;
- friend class CGnuSock;
- friend class CGnuControl;
-
- protected: // create from serialization only
-
- DECLARE_DYNCREATE(CGnucleusDoc)
-
- // Attributes
- public:
- // Should be protected, but there's no other way to have a single doc
- CGnucleusDoc();
-
- // Data lists
- CList<CString,CString&> Connections;
-
- CList<CString,CString&> QueueConnect;
- CList<CString,CString&> QueueDisconnect;
-
- CList<QueryItem,QueryItem&> ActiveDownloads;
- CList<QueryItem,QueryItem&> QueueDownloads;
- CList<QueryItem,QueryItem&> QueueUploads;
-
- std::vector<BlockedSearch> SearchFilter;
- void UpdateSearchViews(packet_QueryReply *);
-
- CString Title;
- DWORD TotalHosts;
- DWORD m_EstSpeed;
-
- int ActiveUploads;
-
- CGnuControl *GnuComm;
-
- /***** GNUCLEUS GLOBAL SETTINGS *****/
-
- // Connect
- long m_ConstPort;
- long m_ConnectSpeed;
- IP m_ForceIP;
- int m_MonitorType;
- int m_ConnectNum;
- int m_TimeoutConnect;
- bool m_DropForIncoming;
-
- // Search
- int m_MaxReplies;
- bool m_bNewAlgorithm;
- // <-- List of Search permissions
- // <-- List of Node permissions
-
- // Download
- CString m_DownloadDir;
- int m_MaxDownloads;
- bool m_AutoClearDL;
- int m_TimeoutDownload;
- bool m_ResumeDL;
-
- // Upload
- int m_MaxUploads;
- bool m_AutoClearUL;
- std::vector<CString> SharedDirList;
- std::vector<DWORD> SharedDirSize;
- std::vector<DWORD> SharedDirCount;
- std::vector<SharedFile> SharedFiles;
- std::vector<DWORD> SharedSizes;
-
- void LockUploadData (bool writeAccess); // Call this before reading or writing the upload data
- void UnlockUploadData (bool writeAccess); // Call this when done reading / writing the upload data
-
- // Bandwidth
- bool m_AutoDropDL;
- bool m_AutoDropUL;
- int m_LimitTotal;
- int m_LimitUp;
- int m_BwVisual;
-
- // Language
- // <-- List of language modules
-
-
- // Operations
- public:
- // Saved Hosts file functions
- void ReadHostsFile();
- void WriteHostsFile();
-
- // INI file functions
- void ReadINI();
- void WriteINI();
-
- // Load share list
- void LoadShare();
- void RecurseShare(CString, bool, DWORD &, DWORD &);
-
- void AddToQueueCache(const CString& inHostPort);
- void RemoveEarliestHostPort(CString* outHostPort);
-
- // Add search request to spy window.
- void UpdateSpy( CString searchText );
-
- CList<CString,CString&> SavedHosts;
-
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CGnucleusDoc)
- public:
- virtual BOOL OnNewDocument();
- virtual void Serialize(CArchive& ar);
- //}}AFX_VIRTUAL
-
- // Implementation
- public:
- CString m_strLangDLLex;
- HINSTANCE m_hLangDLL;
- virtual ~CGnucleusDoc();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
-
- protected:
-
-
- // Generated message map functions
- protected:
- //{{AFX_MSG(CGnucleusDoc)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- int m_readCount;
- int m_writeCount;
-
- private:
- class QueueCache
- {
- public:
- std::set<CString> mHostPorts;
- std::list<std::set<CString>::iterator> mHostPortsQueue;
-
- void PurgeEarliestHostPort(void);
- void AppendLatestHostPort(const CString& inHostPort);
- } ;
-
- QueueCache mQueueCache;
- };
-
- /////////////////////////////////////////////////////////////////////////////
-
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
- #endif // !defined(AFX_GNUCLEUSDOC_H__1AE2E5D0_1AB4_11D4_ACF2_00A0CC533D52__INCLUDED_)
-